#ifndef _SETTINGS_HPP
#define _SETTINGS_HPP



#include "main.hpp"
#include "autofreelist.hpp"

#include "boost/filesystem.hpp"
#include "tinyxml/tinyxml.h"

//For debugging only
#ifndef NDEBUG
void dump_to_stdout(const char* pFilename);
#endif

using namespace Gtk;
using namespace Glib;
using namespace sigc;
using namespace std;
using namespace Gnome;

using namespace boost::filesystem;

const TiXmlElement *XMLGetChildByName(const TiXmlNode &node, const string name);

#ifdef WIN32
#define SETTINGS_FILE "storwords.xml"
#else
#define SETTINGS_FILE "~/.storwords"
#endif

struct AppSettings{
	string Url;
	string Path;
	string User;
	string Pass;
	string EncKey;
	bool SaveKey;
};

static const string SettingsFile=SETTINGS_FILE;

class SettingsManagerClass{
public:
	AppSettings GetSettings();
	void SetSettings(AppSettings newsettings);
	void SaveSettings();
	bool LoadSettings();
	bool CheckSettings(string filename);
private:
	AppSettings settings;
};

extern SettingsManagerClass SettingsManager;
#endif
